from tortoise import fields, models


class User(models.Model):
    email = fields.CharField(max_length=100, unique=True)
    hashed_password = fields.CharField(max_length=150)
    full_name = fields.CharField(max_length=150)
    disabled = fields.BooleanField(default=True)  # User has to be activated by the admin
    is_admin = fields.BooleanField(default=False)
    is_director = fields.BooleanField(default=False)
    is_hr_manager = fields.BooleanField(default=False)
    created_at = fields.DatetimeField(auto_now_add=True)

    class Meta:
        ordering = ["-created_at"]
